package chapter07

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/8 21:23
  * @history:
  *          1.2019/1/8 created by chuhaitao
  */
object OverrideFiled {
  def main(args: Array[String]): Unit = {
    var an = new animal {
      override def sayHi2(): Unit = {
        print(12)
      }
    }
    an.sayHi()
  }

}

abstract class animal {
  def sayHi(): Unit = {
    println("12")
  }

  def sayHi2()
}
